package org.netbeans.swing.tabcontrol.plaf;

import javax.swing.Icon;

public final class DefaultBusyTabsSupport
{
    private static BusyIcon busyIconSelected;
    private static BusyIcon busyIconDefault;

    public static Icon getBusyIcon( boolean isTabSelected ) {
        if( isTabSelected ) {
            if( null == busyIconSelected ) {
                busyIconSelected = BusyIcon.create( isTabSelected );
            }
            return busyIconSelected;
        } else {
            if( null == busyIconDefault ) {
                busyIconDefault = BusyIcon.create( isTabSelected );
            }
            return busyIconDefault;
        }
    }
    
    protected void tick() {
        if( null != busyIconSelected )
            busyIconSelected.tick();

        if( null != busyIconDefault )
            busyIconDefault.tick();
    }
    
    protected int getRepaintTimerIntervalMillis() {
        return 150;
    }
}